'use strict';

const Service = require('egg').Service;

class UserService extends Service {
  async getuser(name) {
    return await this.app.mysql.query(`select * from user where userName='${name}'`);
  }
  async registry(name,realName,pwd){
      return await this.app.mysql.query(`insert into user (userName,realName,password) values ('${name}','${realName}','${pwd}')`);
  }
  async login(name,pwd){
      return await this.app.mysql.query(`select * from user where userName='${name}' and password='${pwd}'`);
  }
}

module.exports = UserService;
